<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>

<body>
    <script>
        if (!'a' in window) {
            var a = '定义变量'
        }
        console.log(a) // ?

    </script>
</body>

</html>